﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class wallRL : MonoBehaviour
{
    public AudioSource m_Ding;
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Ball ball = collision.GetComponent<Ball>();
        if(ball.direction.x >0)
        {
            ball.MoveDir.x*=-1f;
        }
        if (ball.direction.x < 0)
        {
            ball.MoveDir.x *= -1f;
        }
        if (m_Ding)
            m_Ding.Play();
    }
}
